home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-02 | 4.1 KB | 162 lines | [TEXT/KAHL] |
- /******************************************************************************
- x_CQTDoc.cp
-
- CQTDoc Document Class
-
- Copyright © 1995 Gregory Bonk for NewMedia Inc.. All rights reserved.
-
- Generated by Visual Architectâ„¢ 12:55 PM Wed, Aug 2, 1995
-
- This file is rewritten each time you generate code. You should not
- make changes to this file; changes should go in the My.cp
- file, instead.
-
- If you want to change how Visual Architect generates this file, you can
- change the template for this file. It is "_Doc_cp" in the Visual Architect
- Templates folder.
-
- ******************************************************************************/
-
- #include "x_CQTDoc.h"
-
- #include "CQTDoc.h"
-
- #include "CQTDocItems.h"
-
- #include "ViewUtilities.h"
- #include "CQTApp.h"
-
- #include <CApplication.h>
- #include <CBartender.h>
- #include <Commands.h>
- #include <Constants.h>
- #include <CDecorator.h>
- #include <CDesktop.h>
- #include <CFile.h>
- #include <TBUtilities.h>
- #include <CWindow.h>
-
- extern CApplication *gApplication; /* The application */
- extern CDecorator *gDecorator; /* Decorator for arranging windows */
- extern CDesktop *gDesktop; /* The visible Desktop */
- extern CBartender *gBartender; /* Manages all menus */
-
-
- // Define symbols for commands handled by this class
- // Prevents a recompile every time any command changed.
-
- #define cmdImportMovieItem 512
-
-
- TCL_DEFINE_CLASS_M1(x_CQTDoc, x_CQTDoc_super);
-
- /**** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ****/
-
-
- /******************************************************************************
- Ix_CQTDoc
-
- Initialize the document
- ******************************************************************************/
-
- void x_CQTDoc::Ix_CQTDoc()
-
- {
- IDocument(gApplication, TRUE);
-
- // Initialize data members below.
- }
-
-
- /******************************************************************************
- MakeNewWindow
-
- Create a new, empty window. Subclass may override to populate
- the new window.
- ******************************************************************************/
-
- void x_CQTDoc::MakeNewWindow(void)
-
- {
- itsWindow = TCLGetNamedWindow("\pCQTDoc", this);
-
- itsMainPane = (CPane*) TCLGetItemPointer(itsWindow, 0);
-
- // Initialize pointers to the subpanes in the window
-
- }
-
-
- /******************************************************************************
- FailOpen {OVERRIDE}
-
- Fail if file already open in this application.
-
- This function calls the application's FileAlreadyOpen function
- and fails quietly if the file is open.
-
- Note that open may also fail if the file is open in
- another application. This will cause a failure in open,
- but you may wish to override this function to detect this
- case and provide a more meaningful error message than -49.
- ******************************************************************************/
-
- void x_CQTDoc::FailOpen(FSSpec *spec)
- {
- /* Only the application knows */
- if (((CQTApp*)gApplication)->FileAlreadyOpen(spec))
- Failure(kSilentErr, 0);
- }
-
-
- /******************************************************************************
- PositionWindow
-
- The default method in CSaver calls the the decorator, which
- staggers and resizes the window. Since the window has already
- been positioned when it is initialized from the view resource,
- we don't want to do this twice.
- ******************************************************************************/
-
- void x_CQTDoc::PositionWindow()
-
- {
- }
-
-
-
-
- /******************************************************************************
- DoCommand {OVERRIDE}
-
- Dispatch Visual Architect-specified actions.
- ******************************************************************************/
-
- void x_CQTDoc::DoCommand(long theCommand)
-
- {
- switch (theCommand)
- {
- case cmdImportMovieItem:
- break;
- default:
- CDocument::DoCommand(theCommand);
- }
- }
-
-
- /******************************************************************************
- UpdateMenus {OVERRIDE}
-
- Enable menus which generate commands handled by this class.
- ******************************************************************************/
-
- void x_CQTDoc::UpdateMenus()
-
- {
- CDocument::UpdateMenus();
- gBartender->EnableCmd(cmdImportMovieItem);
- }
-
-
-